﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Common;
using Yugi.Client.WebSerive;

namespace Yugi.Client.ViewModel
{
    public class LoginModel 
    {
        public UserLogin userlogin { get; set; }
        public IInvoke Presenter { get; set; }
        public List<PlayerInfo> friend_s { get; set; }
        public BoxUserLogin boxuserlogin { get; set; }
        public void ReceiveMessageFromSupervisor(MSG_GSM Message, params object[] param)
        {
            switch (Message)
            {


            }
        }

        public LoginModel()
        {
            userlogin = new UserLogin();
            boxuserlogin = new BoxUserLogin();
        }
        public void AddPlayerInfo(PlayerInfo item)
        {
            friend_s.Add(item);
        }
        public PlayerInfo getfriend(int UserID)
        {
            foreach (var i in friend_s)
                if (i.ID == UserID)
                    return i;
            return null;
        }
    }
    public class BoxUserLogin
    {
        List<UserLogin> list = new List<UserLogin>();
        public void Add(UserLogin userlogin)
        {
            list.Add(userlogin);
        }
        public void Save()
        {

        }
        public void load()
        {
        }
    }
    public class UserLogin
    {
        public string UserName { get; set; }
        public string Password { get; set; }
        public string GetUserName()
        {
            return UserName.ToLower();//test
        }
        public string GetPassword()
        {
            return Password.ToLower();
        }
        public void SetUserName(string username)
        {
            UserName = username.ToUpper();
        }
        public void SetPassword(string password)
        {
            this.Password = password.ToUpper();
        }
    }
}
